package com.ymatou.iapi.godfreightmgr.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.godfreightmgr.parameter.RefreshUbuyTokenBean;
import com.ymatou.iapi.wxtoken.service.RefreshUbuyTokenCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
/**
*刷新UbuyToken
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_RefreshUbuyToken{
	private static RefreshUbuyTokenBean refreshubuytokenBean;
	private static RefreshUbuyTokenCall refreshubuytokenCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("刷新UbuyToken");
	}

	@Before
	public void caseUp() {
		refreshubuytokenBean=new RefreshUbuyTokenBean();
		refreshubuytokenCall=new RefreshUbuyTokenCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(refreshubuytokenCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	//测试环境不刷数据
	public void Tc_RefreshUbuyToken_001() {
		Logger.start(true,"刷新UbuyToken");
		try {
			//select * from wxtoken where Userid= 500015479 and type = 0 
			//测试时清空该记录token看是否同步过来 数据来源
			//https://ubuy.zoombin.com/api/weixin/accesstoken
			refreshubuytokenBean.setRequestId(null);
			refreshubuytokenCall.setData(refreshubuytokenBean);
			refreshubuytokenCall.callService();			
			Logger.verifyEquals("ok", refreshubuytokenCall.getReturnData(), "验证getReturnData");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}